<template>
  <div>
    <h1 v-demo="sayHello">test</h1>
    <child>
      <template slot-scope="{data}">
        <p v-for="(item ,index) in data" :key="index">{{item}}</p>
      </template>
      <template slot="slot2" slot-scope="{data}">
        {{data}}
      </template>
    </child>
  </div>
</template>

<script>
import child from "@/components/test/lala.vue";
import Vue from "vue";
Vue.directive("demo", {
  inserted: function(el, binding, vnode) {
    binding.value(binding);
  }
});
export default {
  data: function() {
    return {};
  },
  components: {
    child
  },
  methods: {
    sayHello(vnode) {
      console.log(vnode);
    }
  }
};
</script>


